import {BASE_URL} from "./urls.js"

export const  request = (params) => {
	 return new Promise(function(resolve,reject){
		     uni.showLoading({
		     	mask:true,
				title:'正在加载中....'
		     })
			 
			 uni.request({
			 	...params,
				url: BASE_URL + params.url,
				success(res) {
					resolve(res.data)
				},
				fail(error) {
					reject(error)
				},
				complete() {
					uni.hideLoading()
				}
			 })
	 })
}